package com.zhoust.ratelimiter.controller;


import com.zhoust.ratelimiter.annotation.RedisLuaLimiter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 15703
 * @version 1.0
 * @Title
 * @package com.zhoust.commtest.controller
 * @date 2021/4/21 21:03
 * @desc
 */
@RestController
@Slf4j
public class RedisLuaLimiterController {


    /**
     * 在本项目中使用限流
     * @return
     */
    @GetMapping("redisLimit")
    @RedisLuaLimiter(limiter = 1)
    public String redisLimiter(){
        log.info("没被限流！！！") ;
        return "succeed";
    }

}
